package com.czy.controller;

import com.czy.pojo.OperateLog;
import com.czy.pojo.PageResult;
import com.czy.pojo.Result;
import com.czy.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private OperateLogService operateLogService;

    /**
     * 分页查询日志信息
     */
    @GetMapping("/page")
    public Result page(Integer page, Integer pageSize) {
        log.info("分页查询日志信息：{} , {}", page, pageSize);
        PageResult<OperateLog> pageList = operateLogService.page(page, pageSize);
        return Result.success(pageList);
    }
}
